package com.example.demo.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.example.demo.entity.Person;
import com.example.demo.repository.PersonRepository;

@Service
public class PersonService {
	
	@Resource
	private PersonRepository pRepository;
	
	public Person insert(Person person) {
		return pRepository.save(person);
	}
	
	public List<Person> findAll() {
		return pRepository.findAll();
	}
}
